YES 1.2630000000000001
H-Termination proof of /home/matraf/haskell/eval_FullyBlown_Fast/List.hs
H-Termination of the given Haskell-Program with start terms could successfully be proven:
↳ HASKELL
↳ LR
mainModule List
| ((elemIndices :: Bool -> [Bool] -> [Int]) :: Bool -> [Bool] -> [Int]) |
module List where
| import qualified Maybe import qualified Prelude
|
| elemIndices :: Eq a => a -> [a] -> [Int]
elemIndices | x | = | findIndices (== x) |
|
| findIndices :: (a -> Bool) -> [a] -> [Int]
findIndices | p xs | = | concatMap (\vv1 ->
case | vv1 of |
| (x,i) | -> | if p x then i : [] else [] |
| _ | -> | [] |
) (zip xs (enumFrom 0)) |
|
module Maybe where
| import qualified List import qualified Prelude
|
Lambda Reductions:
The following Lambda expression
\vv1→
case | vv1 of |
| (x,i) | → if p x then i : [] else [] |
| _ | → [] |
is transformed to
findIndices0 | p vv1 | =
case | vv1 of | | (x,i) | → if p x then i : [] else [] |
| _ | → [] |
|
The following Lambda expression
\ab→(a,b)
is transformed to
↳ HASKELL
↳ LR
↳ HASKELL
↳ CR
mainModule List
| ((elemIndices :: Bool -> [Bool] -> [Int]) :: Bool -> [Bool] -> [Int]) |
module List where
| import qualified Maybe import qualified Prelude
|
| elemIndices :: Eq a => a -> [a] -> [Int]
elemIndices | x | = | findIndices (== x) |
|
| findIndices :: (a -> Bool) -> [a] -> [Int]
findIndices | p xs | = | concatMap (findIndices0 p) (zip xs (enumFrom 0)) |
|
|
findIndices0 | p vv1 | = |
case | vv1 of |
| (x,i) | -> | if p x then i : [] else [] |
| _ | -> | [] |
|
|
module Maybe where
| import qualified List import qualified Prelude
|
Case Reductions:
The following Case expression
case | vv1 of |
| (x,i) | → if p x then i : [] else [] |
| _ | → [] |
is transformed to
findIndices00 | p (x,i) | = if p x then i : [] else [] |
findIndices00 | p _ | = [] |
↳ HASKELL
↳ LR
↳ HASKELL
↳ CR
↳ HASKELL
↳ IFR
mainModule List
| ((elemIndices :: Bool -> [Bool] -> [Int]) :: Bool -> [Bool] -> [Int]) |
module List where
| import qualified Maybe import qualified Prelude
|
| elemIndices :: Eq a => a -> [a] -> [Int]
elemIndices | x | = | findIndices (== x) |
|
| findIndices :: (a -> Bool) -> [a] -> [Int]
findIndices | p xs | = | concatMap (findIndices0 p) (zip xs (enumFrom 0)) |
|
|
findIndices0 | p vv1 | = | findIndices00 p vv1 |
|
|
findIndices00 | p (x,i) | = | if p x then i : [] else [] |
findIndices00 | p _ | = | [] |
|
module Maybe where
| import qualified List import qualified Prelude
|
If Reductions:
The following If expression
if p x then i : [] else []
is transformed to
findIndices000 | i True | = i : [] |
findIndices000 | i False | = [] |
↳ HASKELL
↳ LR
↳ HASKELL
↳ CR
↳ HASKELL
↳ IFR
↳ HASKELL
↳ BR
mainModule List
| ((elemIndices :: Bool -> [Bool] -> [Int]) :: Bool -> [Bool] -> [Int]) |
module List where
| import qualified Maybe import qualified Prelude
|
| elemIndices :: Eq a => a -> [a] -> [Int]
elemIndices | x | = | findIndices (== x) |
|
| findIndices :: (a -> Bool) -> [a] -> [Int]
findIndices | p xs | = | concatMap (findIndices0 p) (zip xs (enumFrom 0)) |
|
|
findIndices0 | p vv1 | = | findIndices00 p vv1 |
|
|
findIndices00 | p (x,i) | = | findIndices000 i (p x) |
findIndices00 | p _ | = | [] |
|
|
findIndices000 | i True | = | i : [] |
findIndices000 | i False | = | [] |
|
module Maybe where
| import qualified List import qualified Prelude
|
Replaced joker patterns by fresh variables and removed binding patterns.
↳ HASKELL
↳ LR
↳ HASKELL
↳ CR
↳ HASKELL
↳ IFR
↳ HASKELL
↳ BR
↳ HASKELL
↳ COR
mainModule List
| ((elemIndices :: Bool -> [Bool] -> [Int]) :: Bool -> [Bool] -> [Int]) |
module List where
| import qualified Maybe import qualified Prelude
|
| elemIndices :: Eq a => a -> [a] -> [Int]
elemIndices | x | = | findIndices (== x) |
|
| findIndices :: (a -> Bool) -> [a] -> [Int]
findIndices | p xs | = | concatMap (findIndices0 p) (zip xs (enumFrom 0)) |
|
|
findIndices0 | p vv1 | = | findIndices00 p vv1 |
|
|
findIndices00 | p (x,i) | = | findIndices000 i (p x) |
findIndices00 | p vw | = | [] |
|
|
findIndices000 | i True | = | i : [] |
findIndices000 | i False | = | [] |
|
module Maybe where
| import qualified List import qualified Prelude
|
Cond Reductions:
The following Function with conditions
is transformed to
undefined0 | True | = undefined |
undefined1 | | = undefined0 False |
↳ HASKELL
↳ LR
↳ HASKELL
↳ CR
↳ HASKELL
↳ IFR
↳ HASKELL
↳ BR
↳ HASKELL
↳ COR
↳ HASKELL
↳ NumRed
mainModule List
| ((elemIndices :: Bool -> [Bool] -> [Int]) :: Bool -> [Bool] -> [Int]) |
module List where
| import qualified Maybe import qualified Prelude
|
| elemIndices :: Eq a => a -> [a] -> [Int]
elemIndices | x | = | findIndices (== x) |
|
| findIndices :: (a -> Bool) -> [a] -> [Int]
findIndices | p xs | = | concatMap (findIndices0 p) (zip xs (enumFrom 0)) |
|
|
findIndices0 | p vv1 | = | findIndices00 p vv1 |
|
|
findIndices00 | p (x,i) | = | findIndices000 i (p x) |
findIndices00 | p vw | = | [] |
|
|
findIndices000 | i True | = | i : [] |
findIndices000 | i False | = | [] |
|
module Maybe where
| import qualified List import qualified Prelude
|
Num Reduction: All numbers are transformed to thier corresponding representation with Pos, Neg, Succ and Zero.
↳ HASKELL
↳ LR
↳ HASKELL
↳ CR
↳ HASKELL
↳ IFR
↳ HASKELL
↳ BR
↳ HASKELL
↳ COR
↳ HASKELL
↳ NumRed
↳ HASKELL
↳ Narrow
mainModule List
| (elemIndices :: Bool -> [Bool] -> [Int]) |
module List where
| import qualified Maybe import qualified Prelude
|
| elemIndices :: Eq a => a -> [a] -> [Int]
elemIndices | x | = | findIndices (== x) |
|
| findIndices :: (a -> Bool) -> [a] -> [Int]
findIndices | p xs | = | concatMap (findIndices0 p) (zip xs (enumFrom (Pos Zero))) |
|
|
findIndices0 | p vv1 | = | findIndices00 p vv1 |
|
|
findIndices00 | p (x,i) | = | findIndices000 i (p x) |
findIndices00 | p vw | = | [] |
|
|
findIndices000 | i True | = | i : [] |
findIndices000 | i False | = | [] |
|
module Maybe where
| import qualified List import qualified Prelude
|
Haskell To QDPs
↳ HASKELL
↳ LR
↳ HASKELL
↳ CR
↳ HASKELL
↳ IFR
↳ HASKELL
↳ BR
↳ HASKELL
↳ COR
↳ HASKELL
↳ NumRed
↳ HASKELL
↳ Narrow
↳ AND
↳ QDP
↳ QDPSizeChangeProof
↳ QDP
Q DP problem:
The TRS P consists of the following rules:
new_foldr(False, :(ww41110, ww41111), ww7, ww8) → new_foldr(ww41110, ww41111, new_primPlusNat(ww7), new_primPlusNat(ww7))
new_psPs(:(ww41110, ww41111), ww7) → new_foldr(ww41110, ww41111, new_primPlusNat(ww7), new_primPlusNat(ww7))
new_foldr(True, ww4111, ww7, ww8) → new_psPs(ww4111, ww7)
The TRS R consists of the following rules:
new_primPlusNat(Zero) → Succ(Zero)
new_primPlusNat0(Succ(ww500)) → Succ(ww500)
new_primPlusNat(Succ(ww50)) → Succ(Succ(new_primPlusNat0(ww50)))
new_primPlusNat0(Zero) → Zero
The set Q consists of the following terms:
new_primPlusNat(Succ(x0))
new_primPlusNat(Zero)
new_primPlusNat0(Zero)
new_primPlusNat0(Succ(x0))
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem. From the DPs we obtained the following set of size-change graphs:
- new_foldr(False, :(ww41110, ww41111), ww7, ww8) → new_foldr(ww41110, ww41111, new_primPlusNat(ww7), new_primPlusNat(ww7))
The graph contains the following edges 2 > 1, 2 > 2
- new_foldr(True, ww4111, ww7, ww8) → new_psPs(ww4111, ww7)
The graph contains the following edges 2 >= 1, 3 >= 2
- new_psPs(:(ww41110, ww41111), ww7) → new_foldr(ww41110, ww41111, new_primPlusNat(ww7), new_primPlusNat(ww7))
The graph contains the following edges 1 > 1, 1 > 2
↳ HASKELL
↳ LR
↳ HASKELL
↳ CR
↳ HASKELL
↳ IFR
↳ HASKELL
↳ BR
↳ HASKELL
↳ COR
↳ HASKELL
↳ NumRed
↳ HASKELL
↳ Narrow
↳ AND
↳ QDP
↳ QDP
↳ QDPSizeChangeProof
Q DP problem:
The TRS P consists of the following rules:
new_psPs0(:(ww41110, ww41111), ww5) → new_foldr0(ww41110, ww41111, new_primPlusNat(ww5), new_primPlusNat(ww5))
new_foldr0(False, ww4111, ww5, ww6) → new_psPs0(ww4111, ww5)
new_foldr0(True, :(ww41110, ww41111), ww5, ww6) → new_foldr0(ww41110, ww41111, new_primPlusNat(ww5), new_primPlusNat(ww5))
The TRS R consists of the following rules:
new_primPlusNat(Zero) → Succ(Zero)
new_primPlusNat0(Succ(ww500)) → Succ(ww500)
new_primPlusNat(Succ(ww50)) → Succ(Succ(new_primPlusNat0(ww50)))
new_primPlusNat0(Zero) → Zero
The set Q consists of the following terms:
new_primPlusNat(Succ(x0))
new_primPlusNat(Zero)
new_primPlusNat0(Zero)
new_primPlusNat0(Succ(x0))
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem. From the DPs we obtained the following set of size-change graphs:
- new_foldr0(False, ww4111, ww5, ww6) → new_psPs0(ww4111, ww5)
The graph contains the following edges 2 >= 1, 3 >= 2
- new_foldr0(True, :(ww41110, ww41111), ww5, ww6) → new_foldr0(ww41110, ww41111, new_primPlusNat(ww5), new_primPlusNat(ww5))
The graph contains the following edges 2 > 1, 2 > 2
- new_psPs0(:(ww41110, ww41111), ww5) → new_foldr0(ww41110, ww41111, new_primPlusNat(ww5), new_primPlusNat(ww5))
The graph contains the following edges 1 > 1, 1 > 2